#include <stdio.h>
#include <cstype.h>

int const MAXLINE = 1000
char a[MAXLINE];
int getline(void);
void strcat(char* a_First, char* a_Second);

int main (int argc, const char** argv)
{
  while (getline(a,MAXLINE) > 0){
    printf("%s",a);
  }
    
}

int getline(char* a, int lim)
{
  int c,i = 0;
  
  while (--lim > 0 && (c = getchar()) != 'Q'){
    a[i++];
  }
  a[i] = '\0';
  return i;
 }

 void strcat(char* a_First, char* a_Second){

